<%-- 
    Document   : deleteStudent
    Created on : Dec 18, 2014, 2:36:06 PM
    Author     : nga
--%>

<%@page import="dao.StudentDAO"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<!DOCTYPE html>
<%!
    Connection con = null;
    PreparedStatement prst=null;
%>  
<%
    String name = request.getParameter("name");
    String delete = request.getParameter("id");
    String yesbtn = request.getParameter("yes");
    if(yesbtn != null){
        StudentDAO.delete(delete);
        response.sendRedirect("listStudents.jsp");
    }
%>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  </head>

  <body>
    <div class="container">
      <h2>Delete Student</h2>
      <p>Do you want to delete student "<%=name%>"?</p>      
 <table width="200">
  <tr>
    <th scope="col"><input type="submit" name="yes" class="btn btn-primary" id="button" value="Yes"></th>
    <th scope="col"><a href = 'listStudents.jsp'><input type="button" class="btn btn-primary" name="button2" id="button2" value="No"></a></th>
  </tr>
</table> 
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
  </body>

</html>
